package com.itheima.stock.mapper;

import com.itheima.stock.pojo.entity.SysUserRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 13975
* @description 针对表【sys_user_role(用户角色表)】的数据库操作Mapper
* @createDate 2024-04-21 19:31:27
* @Entity com.itheima.stock.pojo.entity.SysUserRole
*/
public interface SysUserRoleMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysUserRole record);

    int insertSelective(SysUserRole record);

    SysUserRole selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUserRole record);

    int updateByPrimaryKey(SysUserRole record);

    /**
     * 根据用户id进行删除
     * @param userId
     * @return
     */
    int deleteByUserId(Long userId);

    /**
     * 批量插入
     * @param arr
     * @return
     */
    int insertBatch(@Param("list") List<SysUserRole> arr);

    /**
     * 按照用户Id进行批量删除
     * @return
     */
    int deleteByIds(@Param("list")List<Long> userIds);

    /**
     * 根据用户角色id删除数据
     * @param id
     * @return
     */
    int deleteByRoleId(Long id);

    List<Long> selectByUserId(@Param("user_id") Long id);
}
